import yaml


class YamlUtil:
    def __init__(self, path):
        self.path = path

    # 读取yaml文件
    def read_yaml(self):
        with open(self.path, 'r') as f:
            value =  yaml.safe_load(f)
            print(value) #转成字典


if __name__ == '__main__':
    YamlUtil('test_api.yaml').read_yaml()